<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@taglib uri="http://www.framework.com/taglib/tree" prefix="tree"%>
<%@ taglib prefix="frame" uri="http://www.framework.com/taglib"%>
  <head>
	<title>个人资料</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<!-- 样式文件的引入 -->
	<link href="${ctx}/commons/css/style.css" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="${ctx}/commons/themes/icon.css"/>
	<!-- jqueryUI JS文件的引入 -->
	<script type="text/javascript" src="${ctx}/commons/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/commons/js/easyui-extends-validate.js"></script>
	<!-- jqueryUI国际化 -->
	<script type="text/javascript" src="${ctx}/commons/js/easyui-lang-zh_CN.js"></script>
	<!-- 开发使用的公用js方法 -->
	<script type="text/javascript" src="${ctx}/commons/js/common.js"></script>
	<!-- 开发国际化的引用，主要完成后台信息在前台提示的国际化，一定要放在最后 -->
	<script type="text/javascript">var ctx = '${ctx}';var actionExt = "action";var i18n = new Object();</script>
	<script src="${ctx}/commons/js/i18n/message_zh_CN.js" type="text/javascript"></script>
	<script type="text/javascript">
	$(function(){
		$("#showDialog").dialog({
			title:'个人资料',
			iconCls:'icon-view',
			addDataFormId:'addDataForm',
			addDialogWidth:700,
			addDialogHeight:300,
			modal: true,
		extractor : function(data){
			if($.trim(data) == "unLogin"){
				var msn = ''||i18n[''];
				msn = msn||i18n[data];
				if(msn != undefined){
					$.messager.alert('提示',msn,'info',function(){top.location='${ctx}/manage';});
					return '';
				}
			}
			return data;
		}, 
			buttons:[{
					text:'保存 ',
					iconCls:'icon-ok',
					handler:function(){
						$("#addDataForm").form('submit',{
			url:'${ctx}/framework/user/save',
			success:function(){
				$.messager.alert('提示',"保存信息成功",'info');
				setTimeout("window.location.href='${ctx}/portal/index.jsp'",800);
			}
		});
		}
		},
		{
			text:'取消',
			iconCls:'icon-cancel',
			handler:function(){
				window.location.href="${ctx}/portal/index.jsp";
			}
		}]
	});
	});
	
	function selectDept(){
		seldeptIdDeptTree($('#deptId').val());
		$('#deptIdDeptTreeDialog').dialog('open');
	}
	function selectPost(){
		selpostIdPostTree($('#postId').val());
		$('#postIdPostTreeDialog').dialog('open');
	}
	</script>
  </head>
 	<!--<style>
  	.infoTable{
  		line-height:30px;
  	}
  	/*.infoTable input{
  		width:100%;
  		height:100%;
  	}*/
   </style>-->
  <body>
	<div id="showDialog" class="showDialog" >
		<form name="addDataForm" id="addDataForm" method="post">
	<input type="hidden" name="id" value="${user.id}"/>
	<input type="hidden" name="createTime" value="${user.createTime}"/>
	<input type="hidden" name="updateTime" value="${user.updateTime}"/>
	<table class="infoTable">
		<tbody>
		<tr>
			<td width="20%" rowspan="6" align="center"><img id="xp" src="${ctx}/commons/images/sailor.png" width="100" alt="人员" title="人员" data="true"/></td>
		</tr>
		<tr>
			<th align="right" width="10%">姓名</th>
			<td><input name="name" class="easyui-validatebox" size="15" value="${user.name}" data-options="required:true" maxlength="10"/>
			</td>
			<th align="right" width="10%">性别</th>
			<td>
			<c:choose>
				<c:when test="${empty user.sex}">
				<c:forEach items="${frame:dictChildren('sex')}" var="sex">
				<input type="radio" name="sex" value="${sex.value}" checked="checked"/>&nbsp;${sex.name}&nbsp;
				</c:forEach>
				</c:when>
				<c:otherwise>
					<c:forEach items="${frame:dictChildren('sex')}" var="sex">
						<c:choose>
						<c:when test="${user.sex==sex.value}">
						<input type="radio" name="sex" value="${sex.value}" checked="checked"/>&nbsp;${sex.name}&nbsp;
						</c:when>
						<c:otherwise><input type="radio" name="sex" value="${sex.value}"/>&nbsp;${sex.name}&nbsp;</c:otherwise>
						</c:choose>
					</c:forEach>
				</c:otherwise>
			</c:choose>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">登录名</th>
			<td><input style="display:none" name="loginName" size="15" value="${user.loginName}" data-options="required:true,validType:['charAndDigit','unique[\'${ctx}\',\'T_SYS_USER_INFO\',\'LOGIN_NAME\',\'${user.id }\']']" maxlength="30"/>
			${user.loginName}</td>
			<th align="right" width="10%">出生日期</th>
			<td><input class="easyui-datebox" name="birthday" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${user.birthday}" />" data-options="validType:['date']" style="width:116px"></input>
			</td>
			<!--<th align="right" width="10%">密码</th>-->
			<td><input style="display:none" type="password" name="psw" class="easyui-validatebox" size="15" value="${user.psw}" data-options="required:true,validType:['isNull','minLength[6]']" maxlength="20"/>
			</td>
		</tr>
		<tr>
			<th align="right" width="10%">联系电话</th>
			<td><input name="tel" class="easyui-validatebox" size="15" value="${user.tel}" maxlength="22"/>
			</td>
			<th align="right" width="10%">手机号码</th>
			<td><input name="mobile" class="easyui-validatebox" size="15" value="${user.mobile}" data-options="validType:['mobile']" maxlength="20"/>
			</td>
		</tr>
			<input type="hidden"  name="limitDate" value="<fmt:formatDate pattern="yyyy-MM-dd" value="${user.limitDate}" />" data-options="validType:['date']" />
		<tr>
			<!--<td align="center"><a href="javascript:void(0);" onclick="openDataDialog(paramObj);" class="easyui-linkbutton" plain="true">上传照片</a>
			</td>
			-->
			<th align="right" width="10%">部门</th>
			<td><input style="display:none" name="deptName" id="deptName" class="easyui-validatebox" size="15" readonly="readonly" data-options="required:true" value="${user.deptName}"/>
			${user.deptName}
			<input type="hidden" name="deptId" id="deptId" class="easyui-validatebox" size="30" value="${user.deptId}"/>
			<span id="pDept" style="display:none;"><a href="javascript:void(0);" onclick="selectDept()"><img src="${ctx}/commons/themes/icons/icon3.gif" border="0" title="所属部门"/></a></span>
			</td>
			<th align="right" width="10%">职务</th>
			<td>${user.postName}
			<input type="hidden" name="postName" id="postName" class="easyui-validatebox" value="${user.postName}" data-options="required:true" size="15" readonly="readonly"/>
			<input type="hidden" name="postId" id="postId" class="easyui-validatebox" size="30" value="${user.postId}"/>
			<span id="pPost" style="display:none;"><a href="javascript:void(0);" onclick="selectPost()"><img src="${ctx}/commons/themes/icons/icon31.png" border="0" title="职务"/></a></span>
			</td>
		</tr>
		</tbody>
	</table>
		<tree:deptTree ctx="${ctx}" deptIds="deptId" deptNames="deptName" selectMethod="single" />
		<tree:postTree ctx="${ctx}" postIds="postId" postNames="postName" selectMethod="single" />
</form>
	</div>
</body>
</html>